Last active
December 9, 2019 07:47
-
-
Save gamaup/aab5e5ed183fdb448fb21d837438d1cf to your computer and use it in GitHub Desktop.
Filter Kurir Rajaongkir pada Plugin Ongkos Kirim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('pok_rates', 'filter_couriers', 10, 2); | |
function filter_couriers($rates, $package) { | |
$filtered_rates = array(); | |
$selected_courier = array( | |
'JNE - REG', | |
'JNE - OKE', | |
'JNE - YES' | |
); | |
foreach ($rates as $r) { | |
if (in_array($r['class'], $selected_courier)) { | |
$filtered_rates[] = $r; | |
} | |
} | |
return $filtered_rates; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sesuaikan $selected_courier dengan nama layanan yang dikehendaki. Pilihan nama-nama layanan bisa dilihat dengan cara mencoba melakukan checkout.